<%@ page contentType="text/html;charset=UTF-8" %>
<%@ include file="/WEB-INF/views/include/taglib.jsp"%>
<script type="text/javascript">
    var flag=1;
    function page(n,s){
        $("#pageNoTop").val(n);
        $("#pageSizeTop").val(s);
        searchDurgPrice(flag);
        return false;
    }
    function searchDurgPrice(type) {
        var form=$("#searchForm");
        if(type==1){
            form.attr("onsubmit","return loadDivForm('mainCenterDiv','searchForm','${ctx}/drug/drugPrice/query');")
            flag=1;
        }else{
            form.attr("onsubmit","return loadDivForm('mainCenterDiv','searchForm','${ctx}/drug/drugPrice/query1');")
            flag=2;
        }
        form.submit();
    }

</script>
    <div class="content-wrap">
        <div class="wrapper" style="bottom: 50px;">
            <ul class="nav nav-tabs">
                <li class="active">
                    <a href="#"   onclick="loadDiv('mainCenterDiv','${ctx}/drug/drugPrice/query?drugInfo.drugDict.drugNameDict.drugCode=${drugPrice.drugInfo.drugDict.drugNameDict.drugCode}')">药品价格列表</a>
                </li>
            </ul>
            <section class="panel panel-default">
                <div class="panel-body">
                    <div class="table-responsive no-border">
                        <div class="datatable-top">
                            <div class="pull-left">
                            	<form:form id="searchForm" modelAttribute="drugPrice"  onsubmit="" method="post" class="form-inline">
                                    <input id="pageNoTop" name="pageNo" type="hidden" value="${page.pageNo}"/>
                                    <input id="pageSizeTop" name="pageSize" type="hidden" value="${page.pageSize}"/>
                                    <label >药品类别:</label>
                                        <sys:treeselect selectedParent="false" id="drugType" name="drugType" value="${drugPrice.drugInfo.drugDict.drugNameDict.drugType}"
                                                        update="${not empty drugPrice.drugInfo.drugDict.drugNameDict.id}" labelName="drugPrice.drugInfo.drugDict.drugNameDict.drugClassDict.className"
                                                        labelValue="${drugPrice.drugInfo.drugDict.drugNameDict.drugClassDict.className}"
                                                        title="药品类别"
                                                        url="/drug/drugClassDict/treeData" extId="${drugPrice.drugInfo.drugDict.drugNameDict.id}" cssClass="form-control"/>
                                    &nbsp;&nbsp;<label>药品名称 ：</label><form:input path="drugInfo.drugDict.drugName" htmlEscape="false" maxlength="50" class="form-control" />
                                    <input id="btnSubmit" class="btn btn-primary" type="button" value="现行价格查询" onclick="searchDurgPrice(1)"/>
                                    <input id="btnSubmit" class="btn btn-primary" type="button" value="历史价格查询" onclick="searchDurgPrice(2)"/>
                                </form:form>

                            </div>
                        </div>
                        <table id="contentTable" class="table table-bordered table-striped mg-t datatable">
                            <thead>
                                <tr>
                                    <%--<th>药品代码</th>--%>
                                    <th>药品名称</th>
                                    <th>药品包装规格</th>
                                    <th>药品单位</th>
                                    <th>厂家标识</th>
                                   <%-- <th>最小单位规格</th>
                                    <th>最小单位</th>--%>
                                    <th>开始日期</th>
                                    <th>结束日期</th>
                                    <th>市场批发价/元</th>
                                    <th>市场零售价/元</th>
                                    <th>费用分类</th>
                                    <th>核算项目分类</th>
                                    <th>会计科目</th>
                                    <th>病案首页分类</th>
                                    <th>最高限价/元</th>
                                </tr>
                            </thead>
                            <tbody>
                            <c:forEach items="${page.list}" var="drugPrice">
                                <tr>
                                    <%--<td> ${drugPrice.drugInfo.drugDict.drugNameDict.drugCode}</td>--%>
                                    <td> ${drugPrice.drugInfo.drugDict.drugNameDict.drugName}</td>
                                    <td> ${drugPrice.packageSpec}</td>
                                    <td> ${fns:getDictLabels(drugPrice.units, 'SPEC_UNIT', '')}</td>
                                    <td> ${drugPrice.drugInfo.drugSupplierCata.supplierName}</td>
                                  <%--  <td> ${drugPrice.drugInfo.minSpec}</td>
                                    <td> ${fns:getDictLabels(drugPrice.drugInfo.minUnits, 'SPEC_UNIT', '')}</td>--%>
                                    <td> <fmt:formatDate value="${drugPrice.startDate}" pattern="yyyy-MM-dd HH:mm:ss"></fmt:formatDate></td>
                                    <td> <fmt:formatDate value="${drugPrice.stopDate}" pattern="yyyy-MM-dd HH:mm:ss"></fmt:formatDate></td>
                                    <td> ${drugPrice.tradePrice}</td>
                                    <td> ${drugPrice.retailPrice}</td>
                                    <td> ${fns:getDictLabels(drugPrice.classOnRcpt, 'OUTP_RCPT_FEE_DICT', '')}</td>
                                    <td> ${fns:getDictLabels(drugPrice.classOnReckoning, 'RECK_ITEM_CLASS_DICT', '')}</td>
                                    <td> ${fns:getDictLabels(drugPrice.classOnMr, 'MR_FEE_CLASS_DICT', '')}</td><td> ${fns:getDictLabels(drugPrice.subjCode, 'TALLY_SUBJECT_DICT', '')}</td>
                                    <td> ${drugPrice.priceMax}</td>
                                </tr>
                            </c:forEach>

                        </table>
                        <div class="pagination">${page}</div>
                    </div>
                </div>
            </section>
        </div>
    </div>